<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="edu.zjut.sjq.bean.User" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  User user= (User) session.getAttribute("user");

%>
<!DOCTYPE html>
<html lang="en" class="app">
<head>  
  <meta charset="utf-8" />
  <title>个人主页</title>
  <meta name="description" content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <link rel="stylesheet" href="${pageContext.request.contextPath}/js/jPlayer/jplayer.flat.css" type="text/css" />
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css" type="text/css" />
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/animate.css" type="text/css" />
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/font-awesome.min.css" type="text/css" />
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/simple-line-icons.css" type="text/css" />
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css" type="text/css" />
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/app.css" type="text/css" />

  <link rel="stylesheet" href="${pageContext.request.contextPath}/js/datepicker/datepicker.css" type="text/css" />
  <link rel="stylesheet" href="${pageContext.request.contextPath}/js/slider/slider.css" type="text/css" />
  <link rel="stylesheet" href="${pageContext.request.contextPath}/js/chosen/chosen.css" type="text/css" />
    <!--[if lt IE 9]>
    <script src="${pageContext.request.contextPath}/js/ie/html5shiv.js"></script>
    <script src="${pageContext.request.contextPath}/js/ie/respond.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/ie/excanvas.js"></script>
  <![endif]-->
</head>
<body class="">

  <section class="vbox">
            <section class="scrollable wrapper">
              <div class="col-lg-offset-4 col-lg-4">
                <section class="panel panel-default">
                  <div class="panel-body">
                    <div class="clearfix text-center m-t">
                      <div class="inline">
                        <div class="easypiechart" data-percent="75" data-line-width="5" data-bar-color="#4cc0c1" data-track-Color="#f5f5f5" data-scale-Color="false" data-size="134" data-line-cap='butt' data-animate="1000">
                          <div class="thumb-lg">
                            <%if (user.getImgUrl()!=null && !user.getImgUrl().equals("")){%>
                            <img src="<%=(basePath)%>${user.imgUrl}" alt="暂无头像">
                            <%}else {%>
                            <img src="${pageContext.request.contextPath}/images/user.png" alt="暂无头像">
                            <%}%>
                          </div>
                        </div>
                        <div class="h4 m-t m-b-xs">${user.username}</div><!-- 用户名为申请的名字 -->
                        <small class="text-muted m-b">
                          <%if (user.getRole()==2){%>
                          <b>管理</b>&nbsp;
                          <%}else if (user.getRole()==1){%>
                          <b>教师</b>&nbsp;
                          <%}else{%>
                          <b>学生</b>&nbsp;
                          <%}%>
                        </small>
                      </div>                      
                    </div>
                  </div>
                </section>
              </div>
              <div class="col-sm-offset-1 col-sm-10">
                <section class="panel panel-default">
                  <header class="panel-heading font-bold">个人主页</header><!-- 设置里面相关的用户信息修改之后 主页的对应信息也要改变 -->
                    <div class="panel-body">
                      <form class="form-horizontal " method="get">
                        <div class="form-group">
                          <label class="col-lg-2 control-label">用户名</label>
                          <div class="col-lg-8">
                            <input type="name" class="form-control" placeholder="Name" value="${user.username}">
                          </div>
                          
                        </div>
                        <div class="line line-dashed b-b line-lg pull-in"></div>

                        <div class="form-group">
                          <label class="col-lg-2 control-label">邮箱</label>
                          <div class="col-lg-8">
                          <input type="email" class="form-control" placeholder="Email" value="${user.mailAddress}">
                          </div>
                          
                        </div>
                        <div class="line line-dashed b-b line-lg pull-in"></div>
                        <div class="form-group">
                          <label class="col-lg-2 control-label">身份</label>
                          <div class="col-lg-8">
                            <%if (user.getRole()==2){%>
                            <label class="radio radio-inline">
                              <input type="radio" name="optionsRadios1" value="option1"  disabled="disabled">
                              <!-- 主页中的角色不可改变-->
                              学生
                            </label>
                            <label class="radio radio-inline">
                              <input type="radio" name="optionsRadios2"  value="option2" disabled="disabled">
                              教师
                            </label>
                            <label class="radio radio-inline">
                              <input type="radio" name="optionsRadios2" value="option2" checked disabled="disabled">
                              管理
                            </label>
                            <%}else if(user.getRole()==1){%>
                            <label class="radio radio-inline">
                              <input type="radio" name="optionsRadios1" value="option1"  disabled="disabled">
                              <!-- 主页中的角色不可改变-->
                              学生
                            </label>
                            <label class="radio radio-inline">
                              <input type="radio" name="optionsRadios2"  value="option2" checked disabled="disabled">
                              教师
                            </label>
                            <label class="radio radio-inline">
                              <input type="radio" name="optionsRadios2"  value="option2" disabled="disabled">
                              管理
                            </label>
                            <%}else{%>
                            <label class="radio radio-inline">
                              <input type="radio" name="optionsRadios1"  value="option1" checked disabled="disabled">
                              <!-- 主页中的角色不可改变-->
                              学生
                            </label>
                            <label class="radio radio-inline">
                              <input type="radio" name="optionsRadios2" value="option2" disabled="disabled">
                              教师
                            </label>
                            <label class="radio radio-inline">
                              <input type="radio" name="optionsRadios2"  value="option2" disabled="disabled">
                              管理
                            </label>
                            <%}%>
                          </div>
                          
                        </div>
                        <div class="line line-dashed b-b line-lg pull-in"></div>
                        <div class="form-group">
                          <label class="col-lg-2 control-label">学校</label>
                          <div class="col-lg-8">
                            <%if (user.getSchoolName()!=null && !user.getSchoolName().equals("")){%>
                            <input type="name" class="form-control" placeholder="School Name" value="${user.schoolName}">
                            <%}else{%>
                            <input type="name" class="form-control" placeholder="School Name" value="暂未填写信息">
                            <%}%>
                          </div>
                        </div>
                        <div class="line line-dashed b-b line-lg pull-in"></div>
                        <div class="form-group">
                          <label class="col-lg-2 control-label">专业</label>
                          <div class="col-lg-8">
                            <%if (user.getSchoolName()!=null && !user.getSchoolName().equals("")){%>
                            <input type="name" class="form-control" placeholder="Major Name" value="${user.majorName}">
                            <%}else{%>
                            <input type="name" class="form-control" placeholder="Major Name" value="暂未填写信息">
                            <%}%>
                          </div>
                        </div>
                        <div class="line line-dashed b-b line-lg pull-in"></div>
                        <div class="form-group">
                          <label class="col-lg-2 control-label">姓名</label>
                          <div class="col-lg-8">
                            <%if (user.getSchoolName()!=null && !user.getSchoolName().equals("")){%>
                            <input type="name" class="form-control" placeholder="Actual Name" value="${user.actualName}">
                            <%}else{%>
                            <input type="name" class="form-control" placeholder="Actual Name" value="暂未填写信息">
                            <%}%>
                          </div>
                        </div>
                        <div class="line line-dashed b-b line-lg pull-in"></div>
                        <div class="form-group">
                          <label class="col-lg-2 control-label">性别</label>
                          <div class="col-lg-8">
                              <%if (user.getSex()==null){%>
                                <label class="radio radio-inline">
                                  <input type="radio" name="optionsRadios4"  value="option4"  disabled="disabled">
                                    男
                                </label>
                                <label class="radio radio-inline">
                                  <input type="radio" name="optionsRadios4"  value="option4"  disabled="disabled">
                                  女
                                </label>
                                <label class="radio radio-inline">
                                <input type="radio" name="optionsRadios4"  value="option4" checked disabled="disabled">
                                  未定
                                </label>
                              <%}else if (user.getSex()==1){%>
                                <label class="radio radio-inline">
                                  <input type="radio" name="optionsRadios3"  value="option3"  disabled="disabled">
                                    女
                                </label>
                                <label class="radio radio-inline">
                                  <input type="radio" name="optionsRadios4"  value="option4" checked disabled="disabled">
                                  男
                                </label>
                              <%}else {%>
                            <label class="radio radio-inline">

                            <input type="radio" name="optionsRadios3"  value="option3" checked disabled="disabled">
                                  女
                                </label>
                                <label class="radio radio-inline">
                                  <input type="radio" name="optionsRadios4" value="option4" disabled="disabled">
                                  男
                                </label>
                              <%}%>

                          </div>
                        </div>
                        <div class="line line-dashed b-b line-lg pull-in"></div>
                        <div class="form-group">
                          <label class="col-lg-2 control-label">电话</label>
                          <div class="col-lg-8">
                            <%if (user.getSchoolName()!=null && !user.getSchoolName().equals("")){%>
                            <input type="name" class="form-control" placeholder="Phone Number" value="${user.phone}">
                            <%}else{%>
                            <input type="name" class="form-control" placeholder="Phone Number" value="暂未填写信息">
                            <%}%>
                          </div>
                          
                        </div>     
                    </form>
                  </div>
                </section>
              </div>
             
                
            </section>
          </section>

  <script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
  <!-- Bootstrap -->
  <script src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
  <!-- App -->
  <script src="${pageContext.request.contextPath}/js/app.js"></script>

  <!-- datepicker -->
  <script src="${pageContext.request.contextPath}/js/datepicker/bootstrap-datepicker.js"></script>
  <!-- slider -->
  <script src="${pageContext.request.contextPath}/js/slider/bootstrap-slider.js"></script>
  <!-- file input -->  
  <script src="${pageContext.request.contextPath}/js/file-input/bootstrap-filestyle.min.js"></script>
  <!-- wysiwyg -->
  <script src="${pageContext.request.contextPath}/js/wysiwyg/jquery.hotkeys.js"></script>
  <script src="${pageContext.request.contextPath}/js/wysiwyg/bootstrap-wysiwyg.js"></script>
  <script src="${pageContext.request.contextPath}/js/wysiwyg/demo.js"></script>
  <!-- markdown -->
  <script src="${pageContext.request.contextPath}/js/markdown/epiceditor.min.js"></script>
  <script src="${pageContext.request.contextPath}/js/markdown/demo.js"></script>

  <script src="${pageContext.request.contextPath}/js/slimscroll/jquery.slimscroll.min.js"></script>
  <script src="${pageContext.request.contextPath}/js/app.plugin.js"></script>
  <script type="text/javascript" src="${pageContext.request.contextPath}/js/jPlayer/jquery.jplayer.min.js"></script>
  <script type="text/javascript" src="${pageContext.request.contextPath}/js/jPlayer/add-on/jplayer.playlist.min.js"></script>
  <script type="text/javascript" src="${pageContext.request.contextPath}/js/jPlayer/demo.js"></script>

</body>
</html>